from info import redis_store
from  . import  index_biu   #从同级目录下导入
from flask import render_template, current_app


@index_biu.route('/')
def index():
    #session["name"] = "itheima"
    # logging.debug("This is a debug log.")
    # logging.info("This is a info log.")
    # logging.warning("This is a warning log.")
    # logging.error("This is a error log.")
    # #flask里面不使用logging.来查看日志使用current_app.logger.来查看
    # current_app.logger.error("测试error")
    # redis_store.set("name","IT")
    return render_template('news/index.html')

#在打开网页的时候,浏览器会默认去请求根路径+favicon.ico做网站标签的小图标
#send_static_file是flask去查找指定的静态文件所调用的方法
@index_biu.route('/favicon.ico')
def favicon():
    return current_app.send_static_file('news/favicon.ico')
